<?php /* Smarty version 2.6.20, created on 2011-10-25 17:21:55
         compiled from _core/_include/module/_mvc/control/handletablecontractproduct.tpl */ ?>
function HandleTableContractProduct(gui, item, options) {
  this._gui = gui;
  this._item = item;
  this._options = options;
  
  this._createElements();
}

HandleTableContractProduct.prototype._createElements = function() {
  var tr, td, _self = this;
  
  if (this._item.length == 0) {
    tr = this._gui.pTable.insertRow(-1);
    td = tr.insertCell(-1);
    td.colSpan = 3;
    td.style.height = '30px';
    td.style.textAlign = 'center';
    td.appendChild(document.createTextNode('N/A'));
  }
  
  MiscUtils.sort(this._item, ['name']);
  for (var i = 0, il = this._item.length; i < il; i++) {
    var purchase = this._item[i];
    if (purchase.cancelled == 1) {
      continue;
    }
    tr = this._gui.pTable.insertRow(-1);
    new ITableRowContractProduct(tr, purchase, this._options);
  }
};